parameters:
  runtimeFlavor: 'coreclr'
  jobTemplate: ''
  buildConfig: ''
  platforms: []
  # platformGroup is a named collection of platforms. Allowed values:
  # 'all' - all platforms
  # 'gcstress' - platforms that support running under GCStress0x3 and GCStress0xC scenarios
  platformGroup: ''
  # helixQueueGroup is a named collection of Helix Queues. If specified, it determines which Helix queues are
  # used, instead of the usual criteria. Values that must be supported by the supplied helixQueuesTemplate:
  # 'pr' - the queues used for a pull request for the platform. Typically a small set.
  # 'ci' - the queues used for a CI (post-merge) test run.
  # Other values might be supported by the template specified in helixQueuesTemplate, but they do not have specified
  # meanings here.
  helixQueueGroup: 'pr'
  # helixQueuesTemplate is a yaml template which will be expanded in order to set up the helix queues
  # for the given platform and helixQueueGroup.
  helixQueuesTemplate: ''
  container: ''
  shouldContinueOnError: false
  jobParameters: {}
  variables: []

jobs:

# Linux arm

- ${{ if or(containsValue(parameters.platforms, 'linux_arm'), in(parameters.platformGroup, 'all', 'gcstress')) }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: linux
      archType: arm
      targetRid: linux-arm
      platform: linux_arm
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: linux_arm
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        crossBuild: true
        ${{ insert }}: ${{ parameters.jobParameters }}

# Linux armv6

- ${{ if containsValue(parameters.platforms, 'linux_armv6') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: linux
      archType: armv6
      targetRid: linux-armv6
      platform: linux_armv6
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: linux_armv6
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        crossBuild: true
        ${{ insert }}: ${{ parameters.jobParameters }}

# Linux arm64

- ${{ if or(containsValue(parameters.platforms, 'linux_arm64'), in(parameters.platformGroup, 'all', 'gcstress')) }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: linux
      archType: arm64
      targetRid: linux-arm64
      platform: linux_arm64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      ${{ if eq(parameters.container, '') }}:
        container: linux_arm64
      ${{ if ne(parameters.container, '') }}:
        container:
          image: ${{ parameters.container }}
          registry: mcr
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        crossBuild: true
        ${{ insert }}: ${{ parameters.jobParameters }}

# Linux musl x64

- ${{ if or(containsValue(parameters.platforms, 'linux_musl_x64'), eq(parameters.platformGroup, 'all')) }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: linux
      osSubgroup: _musl
      archType: x64
      targetRid: linux-musl-x64
      platform: linux_musl_x64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: linux_musl_x64
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        crossBuild: true
        ${{ insert }}: ${{ parameters.jobParameters }}

# Linux musl arm

- ${{ if or(containsValue(parameters.platforms, 'linux_musl_arm'), eq(parameters.platformGroup, 'all')) }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: linux
      osSubgroup: _musl
      archType: arm
      targetRid: linux-musl-arm
      platform: linux_musl_arm
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: linux_musl_arm
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        crossBuild: true
        ${{ insert }}: ${{ parameters.jobParameters }}

# Linux musl arm64

- ${{ if or(containsValue(parameters.platforms, 'linux_musl_arm64'), eq(parameters.platformGroup, 'all')) }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: linux
      osSubgroup: _musl
      archType: arm64
      targetRid: linux-musl-arm64
      platform: linux_musl_arm64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: linux_musl_arm64
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        crossBuild: true
        ${{ insert }}: ${{ parameters.jobParameters }}

# Linux Bionic arm

- ${{ if containsValue(parameters.platforms, 'linux_bionic_arm') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: linux
      osSubgroup: _bionic
      archType: arm
      targetRid: linux-bionic-arm
      platform: linux_bionic_arm
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: linux_bionic
      jobParameters:
        runtimeFlavor: mono
        # We build on Linux, but the test queue runs Windows, so
        # we need to override the test script generation
        runScriptWindowsCmd: true
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# Linux Bionic arm64

- ${{ if containsValue(parameters.platforms, 'linux_bionic_arm64') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: linux
      osSubgroup: _bionic
      archType: arm64
      targetRid: linux-bionic-arm64
      platform: linux_bionic_arm64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: linux_bionic
      jobParameters:
        runtimeFlavor: mono
        # We build on Linux, but the test queue runs Windows, so
        # we need to override the test script generation
        runScriptWindowsCmd: true
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# Linux Bionic x64

- ${{ if containsValue(parameters.platforms, 'linux_bionic_x64') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: linux
      osSubgroup: _bionic
      archType: x64
      targetRid: linux-bionic-x64
      platform: linux_bionic_x64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: linux_bionic
      jobParameters:
        runtimeFlavor: mono
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# Linux x64

- ${{ if or(containsValue(parameters.platforms, 'linux_x64'), containsValue(parameters.platforms, 'CoreClrTestBuildHost'), in(parameters.platformGroup, 'all', 'gcstress')) }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: linux
      archType: x64
      targetRid: linux-x64
      platform: linux_x64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      ${{ if eq(parameters.container, '') }}:
        container: linux_x64
      ${{ if ne(parameters.container, '') }}:
        container:
          image: ${{ parameters.container }}
          registry: mcr
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        crossBuild: true
        ${{ insert }}: ${{ parameters.jobParameters }}

# Linux x86

- ${{ if containsValue(parameters.platforms, 'linux_x86') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: linux
      archType: x86
      targetRid: linux-x86
      platform: linux_x86
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: linux_x86
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        crossBuild: true
        ${{ insert }}: ${{ parameters.jobParameters }}

# Runtime-dev-innerloop build

- ${{ if containsValue(parameters.platforms, 'linux_x64_dev_innerloop') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: linux
      archType: x64
      targetRid: linux-x64
      platform: linux_x64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: linux_x64_dev_innerloop
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# Centos 8 Stream x64 Source Build

- ${{ if containsValue(parameters.platforms, 'SourceBuild_centos8_x64') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: linux
      archType: x64
      targetRid: centos.8-x64
      platform: centos8_linux_x64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: SourceBuild_centos_x64
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        isSourceBuild: true
        isNonPortableSourceBuild: true
        ${{ insert }}: ${{ parameters.jobParameters }}

# Non-existent RID Source Build

- ${{ if containsValue(parameters.platforms, 'SourceBuild_banana24_x64') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: linux
      archType: x64
      targetRid: banana.24-x64
      platform: banana24_linux_x64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: SourceBuild_centos_x64 # Run the unknown-rid build on a platform with a known RID so our RID graph tooling can automatically add it to the RID graph.
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        baseOS: linux
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        isSourceBuild: true
        isNonPortableSourceBuild: true
        ${{ insert }}: ${{ parameters.jobParameters }}

# Portable Linux x64 Source Build

- ${{ if containsValue(parameters.platforms, 'SourceBuild_linux_x64') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: linux
      archType: x64
      targetRid: linux-x64
      platform: linux_x64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: SourceBuild_linux_x64
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        isSourceBuild: true
        isNonPortableSourceBuild: false
        ${{ insert }}: ${{ parameters.jobParameters }}

# GCC Linux x64 Build

- ${{ if containsValue(parameters.platforms, 'gcc_linux_x64') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: linux
      archType: x64
      targetRid: linux-x64
      platform: linux_x64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: debian-12-gcc13-amd64
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# Mono LLVMAot test build

- ${{ if containsValue(parameters.platforms, 'linux_x64_llvmaot') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: linux
      archType: x64
      targetRid: linux-x64
      platform: linux_x64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: linux_x64_llvmaot
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# Linux s390x

- ${{ if containsValue(parameters.platforms, 'linux_s390x') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: linux
      archType: s390x
      targetRid: linux-s390x
      platform: linux_s390x
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: linux_s390x
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        crossBuild: true
        ${{ insert }}: ${{ parameters.jobParameters }}

# Linux PPC64le

- ${{ if containsValue(parameters.platforms, 'linux_ppc64le') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: linux
      archType: ppc64le
      targetRid: linux-ppc64le
      platform: linux_ppc64le
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: linux_ppc64le
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        crossBuild: true
        ${{ insert }}: ${{ parameters.jobParameters }}

# Linux RISCV64

- ${{ if containsValue(parameters.platforms, 'linux_riscv64') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: linux
      archType: riscv64
      targetRid: linux-riscv64
      platform: linux_riscv64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: linux_riscv64
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        crossBuild: true
        ${{ insert }}: ${{ parameters.jobParameters }}

# WASI WebAssembly

- ${{ if containsValue(parameters.platforms, 'wasi_wasm') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: wasi
      archType: wasm
      targetRid: wasi-wasm
      platform: wasi_wasm
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: wasi_wasm
      jobParameters:
        hostedOs: linux
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        stagedBuild: ${{ parameters.stagedBuild }}
        buildConfig: ${{ parameters.buildConfig }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# WASI WebAssembly windows

- ${{ if containsValue(parameters.platforms, 'wasi_wasm_win') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: wasi
      archType: wasm
      targetRid: wasi-wasm
      platform: wasi_wasm_win
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      jobParameters:
        hostedOs: windows
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        stagedBuild: ${{ parameters.stagedBuild }}
        buildConfig: ${{ parameters.buildConfig }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# Browser WebAssembly

- ${{ if containsValue(parameters.platforms, 'browser_wasm') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: browser
      archType: wasm
      targetRid: browser-wasm
      platform: browser_wasm
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: browser_wasm
      jobParameters:
        hostedOs: linux
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# Browser WebAssembly Linux Firefox

- ${{ if containsValue(parameters.platforms, 'browser_wasm_firefox') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: browser
      archType: wasm
      targetRid: browser-wasm
      platform: browser_wasm_firefox
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: browser_wasm
      jobParameters:
        hostedOs: linux
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# Browser WebAssembly on Windows

- ${{ if containsValue(parameters.platforms, 'browser_wasm_win') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: browser
      archType: wasm
      targetRid: browser-wasm
      platform: browser_wasm_win
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      jobParameters:
        hostedOs: windows
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# FreeBSD
- ${{ if containsValue(parameters.platforms, 'freebsd_x64') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: freebsd
      archType: x64
      targetRid: freebsd-x64
      platform: freebsd_x64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: freebsd_x64
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        crossBuild: true
        ${{ insert }}: ${{ parameters.jobParameters }}

# Android x64

- ${{ if containsValue(parameters.platforms, 'android_x64') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: android
      archType: x64
      targetRid: android-x64
      platform: android_x64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: linux_bionic
      jobParameters:
        runtimeFlavor: mono
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# Android x64 with Docker-in-Docker

- ${{ if containsValue(parameters.platforms, 'android_x64_docker') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: android
      archType: x64
      targetRid: android-x64
      platform: android_x64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: android_docker
      jobParameters:
        runtimeFlavor: mono
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# Android x86

- ${{ if containsValue(parameters.platforms, 'android_x86') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: android
      archType: x86
      targetRid: android-x86
      platform: android_x86
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: linux_bionic
      jobParameters:
        runtimeFlavor: mono
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# Android arm

- ${{ if containsValue(parameters.platforms, 'android_arm') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: android
      archType: arm
      targetRid: android-arm
      platform: android_arm
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: linux_bionic
      jobParameters:
        runtimeFlavor: mono
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# Android arm64

- ${{ if containsValue(parameters.platforms, 'android_arm64') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: android
      archType: arm64
      targetRid: android-arm64
      platform: android_arm64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: linux_bionic
      jobParameters:
        runtimeFlavor: mono
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# Mac Catalyst x64

- ${{ if containsValue(parameters.platforms, 'maccatalyst_x64') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: maccatalyst
      archType: x64
      targetRid: maccatalyst-x64
      platform: maccatalyst_x64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      jobParameters:
        ${{ if eq(parameters.runtimeFlavor, '') }}:
          runtimeFlavor: mono
        ${{ else }}:
          runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# Mac Catalyst arm64

- ${{ if containsValue(parameters.platforms, 'maccatalyst_arm64') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: maccatalyst
      archType: arm64
      targetRid: maccatalyst-arm64
      platform: maccatalyst_arm64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      jobParameters:
        ${{ if eq(parameters.runtimeFlavor, '') }}:
          runtimeFlavor: mono
        ${{ else }}:
          runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# tvOS arm64

- ${{ if containsValue(parameters.platforms, 'tvos_arm64') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: tvos
      archType: arm64
      targetRid: tvos-arm64
      platform: tvos_arm64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      jobParameters:
        ${{ if eq(parameters.runtimeFlavor, '') }}:
          runtimeFlavor: mono
        ${{ else }}:
          runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# tvOS Simulator x64

- ${{ if containsValue(parameters.platforms, 'tvossimulator_x64') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: tvossimulator
      archType: x64
      targetRid: tvossimulator-x64
      platform: tvossimulator_x64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      jobParameters:
        ${{ if eq(parameters.runtimeFlavor, '') }}:
          runtimeFlavor: mono
        ${{ else }}:
          runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# tvOS Simulator arm64

- ${{ if containsValue(parameters.platforms, 'tvossimulator_arm64') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: tvossimulator
      archType: arm64
      targetRid: tvossimulator-arm64
      platform: tvossimulator_arm64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      jobParameters:
        ${{ if eq(parameters.runtimeFlavor, '') }}:
          runtimeFlavor: mono
        ${{ else }}:
          runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# iOS arm64

- ${{ if containsValue(parameters.platforms, 'ios_arm64') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: ios
      archType: arm64
      targetRid: ios-arm64
      platform: ios_arm64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      jobParameters:
        ${{ if eq(parameters.runtimeFlavor, '') }}:
          runtimeFlavor: mono
        ${{ else }}:
          runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# iOS Simulator x64

- ${{ if containsValue(parameters.platforms, 'iossimulator_x64') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: iossimulator
      archType: x64
      targetRid: iossimulator-x64
      platform: iossimulator_x64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      jobParameters:
        ${{ if eq(parameters.runtimeFlavor, '') }}:
          runtimeFlavor: mono
        ${{ else }}:
          runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# iOS Simulator arm64

- ${{ if containsValue(parameters.platforms, 'iossimulator_arm64') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: iossimulator
      archType: arm64
      targetRid: iossimulator-arm64
      platform: iossimulator_arm64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      jobParameters:
        ${{ if eq(parameters.runtimeFlavor, '') }}:
          runtimeFlavor: mono
        ${{ else }}:
          runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# macOS arm64

- ${{ if containsValue(parameters.platforms, 'osx_arm64') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: osx
      archType: arm64
      targetRid: osx-arm64
      platform: osx_arm64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        crossBuild: true
        ${{ insert }}: ${{ parameters.jobParameters }}

# macOS x64

- ${{ if or(containsValue(parameters.platforms, 'osx_x64'), eq(parameters.platformGroup, 'all')) }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: osx
      archType: x64
      targetRid: osx-x64
      platform: osx_x64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# Tizen armel

- ${{ if containsValue(parameters.platforms, 'tizen_armel') }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: linux # Our build scripts don't support Tizen and have always used Linux as the OS parameter.
      archType: armel
      targetRid: tizen-armel
      platform: tizen_armel
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      container: tizen_armel
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        crossBuild: true
        ${{ insert }}: ${{ parameters.jobParameters }}

# Windows x64

- ${{ if or(containsValue(parameters.platforms, 'windows_x64'), in(parameters.platformGroup, 'all', 'gcstress')) }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: windows
      archType: x64
      targetRid: win-x64
      platform: windows_x64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# Windows x86

- ${{ if or(containsValue(parameters.platforms, 'windows_x86'), in(parameters.platformGroup, 'all', 'gcstress')) }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: windows
      archType: x86
      targetRid: win-x86
      platform: windows_x86
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        ${{ insert }}: ${{ parameters.jobParameters }}

# Windows arm64

- ${{ if or(containsValue(parameters.platforms, 'windows_arm64'), in(parameters.platformGroup, 'all', 'gcstress')) }}:
  - template: xplat-setup.yml
    parameters:
      jobTemplate: ${{ parameters.jobTemplate }}
      helixQueuesTemplate: ${{ parameters.helixQueuesTemplate }}
      variables: ${{ parameters.variables }}
      osGroup: windows
      archType: arm64
      targetRid: win-arm64
      platform: windows_arm64
      shouldContinueOnError: ${{ parameters.shouldContinueOnError }}
      jobParameters:
        runtimeFlavor: ${{ parameters.runtimeFlavor }}
        buildConfig: ${{ parameters.buildConfig }}
        helixQueueGroup: ${{ parameters.helixQueueGroup }}
        ${{ insert }}: ${{ parameters.jobParameters }}
